package org.southyin.ioc.test01;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class PersonTest {

    public static Logger log = LoggerFactory.getLogger(PersonTest.class);

    public static void main(String[] args) {
        // 1.new
        // 2.工厂
        // 3.反射
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");
        Person person = context.getBean("person2", Person.class);
        log.info(person.toString());


//        Person person1 = context.getBean("person", Person.class);
//        System.out.println(person == person1);
//        log.info("hello1");
//        log.error("hello2");
//        log.debug((person == person1)+"");
    }
}
